//#include<iostream>
//#include<map>
//#include<string> 
//using namespace std;




//int main()
//{
//    string n;
//    cin >> n;
//    map<string, pair<int, int > >  m;
//    m["A0"] = { 1189,841 };
//
//    return 0;
//}


#include<iostream>
#define  int long long
using namespace std;
signed main()
{
    int  m = 0;
    cin >> m;

    int hour = 0, minute = 0, second = 0;
    hour = m / 3600000;
    if (hour > 23)
    {
        hour %= 24;
    }
    m -= hour * 3600000;

    minute = m / 60000;
    if (minute > 59)
    {
        minute %= 60;
    }
    m -= minute * 60000;
    second = m / 1000;
    if (second > 59)
    {
        second %= 60;
    }

     if (second >= 0 && second <= 9 && minute >= 0 && minute <= 9 && hour >= 0 && hour <= 9)
        cout << "0" << hour << ":" << "0" << minute << ":" << "0" << second;

     else if (hour>=10 && minute >= 0 && minute <= 9 && second >= 0 && second <= 9)
         cout << hour << ":" << "0" << minute << ":" << "0" << second;


     else if (hour >= 0 && hour <= 9 && minute >= 0 && minute <= 9 && second >=10)
         cout << "0"<<hour << ":" << "0" << minute << ":" <<  second;




     else  if (hour >= 10 &&  minute >= 10 && second >= 0 && second <= 9)
        cout << hour << ":" << minute << ":" << "0" << second;


    else
        cout << hour << ":" << minute << ":" << second;
    return 0;
}